//
//
//  Generated by StarUML(tm) C++ Add-In
//
//  @ Project : OOAD5T
//  @ File Name : MotorController.h
//  @ Date : 2026-05-03
//  @ Author : 
//
//


#if !defined(_MOTORCONTROLLER_H)
#define _MOTORCONTROLLER_H

#include "IPower.h"
#include "SensorProvider.h"
#include "EventBus.h"
#include "HDWARE/Motor.h"

class MotorController : public IPower {
public:
	MotorController(EventBus* bus, Motor& motor);
	void turnOn();
	void turnOff() override;
	void AvoidObstacle(SensorProvider& provider);
	void MCStop();
	void MCMove();
	bool isAvoiding() const;

private:
	EventBus* bus;
	SensorProvider* mySensor = nullptr;
	Motor& motor;
	bool isTurnOn;
	bool avoiding = false;
	void MCTurnLeft();
	void MCTurnRight();
	void MCMoveBackward();
};

#endif  //_MOTORCONTROLLER_H
